package com.ji.service;

import com.ji.dao.DepartmentMapper;
import com.ji.pojo.Department;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentServiceImpl implements DepartmentService{
    @Autowired
    private DepartmentMapper departmentMapper;

    @Override
    public int addDepartment(Department department) {
        return departmentMapper.addDepartment (department);
    }

    @Override
    public int deleteDepartment(int id) {
        return departmentMapper.deleteDepartment (id);
    }

    @Override
    public int updateDepartment(Department department) {
        return departmentMapper.updateDepartment (department);
    }

    @Override
    public List<Department> queryAllDepartment() {
        return departmentMapper.queryAllDepartment ();
    }

    @Override
    public Department queryDepartment(int id) {
        return departmentMapper.queryDepartment (id);
    }
}
